package com.shencai.demo.base.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shencai.demo.base.entity.SysMenu;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* @author sckj
* @description 针对表【sys_menu(菜单表)】的数据库操作Service
* @createDate 2022-10-19 11:04:48
*/
public interface SysMenuService extends IService<SysMenu> {


    /**
     * 获取菜单树
     */
    List<SysMenu> listMenuTree();

    /**
     * 获取菜单的下一级菜单
     * @param id
     * @return
     */
    List<SysMenu> listNextMenus(Integer id);

    /**
     * 根据菜单名称和菜单编号模糊查询
     * @param name
     * @param code
     * @return
     */
    List<SysMenu> ListMenuByNameAndCode(String name, String code);

    /**
     * 分页获取菜单的下一级菜单
     * @param id
     * @param currentPage
     * @param pageSize
     * @return
     */
    Page<SysMenu> listNextMenusByPage(Integer id, Integer currentPage, Integer pageSize);

    /**
     * 根据菜单名和菜单编码模糊分页查询菜单
     * @param name
     * @param code
     * @param currentPage
     * @param pageSize
     * @return
     */
    Page<SysMenu> ListMenuByNameAndCodeBypage(String name, String code, Integer currentPage, Integer pageSize);

    /**
     * 添加菜单
     * @param menu
     * @return
     */
    boolean saveMenu(SysMenu menu);

    /**
     * 删除菜单
     * @param id
     * @return
     */
    boolean removeMenuById(Integer id);

}
